package com.kgc.service;

import com.kgc.bean.User;
import com.kgc.util.ReturnResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @Classname FootPrintService
 * @Description TODO
 * @Date 2021/6/20 21:30
 * @Created by 17402
 */
public interface FootPrintService {
    //将商品存到cokie中
    ReturnResult<Map<String,Object>> addFootPrint2Cookie(String goodsId, HttpServletRequest req, HttpServletResponse resp);
    //将商品存入足迹表
    ReturnResult<Map<String,Object>> addFootPrint2Database(String token, String goodsId);
    //从cookie中读取足迹
    ReturnResult<Map<String, Object>> readFootPrintFromCookie(HttpServletRequest req);
    //从数据库读取足迹
    ReturnResult<Map<String, Object>> readFootPrintFromDatabase(User user);
    //返回cookie足迹中的商品id
    List<String> getGoodsIdFromCookies(HttpServletRequest req);
    //登录后清除cookie足迹
    void delGoodsIdFromCookies(HttpServletRequest req, HttpServletResponse resp);
}
